﻿<UserControl x:Class="Modules.OrderTicket.OrderTicketView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             mc:Ignorable="d">

    <StackPanel Orientation="Vertical" Background="{StaticResource LightBackground}">
        <GroupBox Header="Place Order" HorizontalAlignment="Left" Margin="10,10,10,10">
            <StackPanel Orientation="Vertical" Background="{StaticResource LightBackground}">
                <StackPanel Orientation="Horizontal">
                    <Label Content="{Binding FullSymbol}" Foreground="{StaticResource Foreground}" Margin="10,10,0,0" Height="30" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center"></Label>
                    <Button Content="Place Order" Margin="20,10,0,0" Height="30" Width="100" Command="{Binding PlaceOrderCmd}"></Button>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label Content="Buy/Sell" Foreground="{StaticResource Foreground}" Margin="10,10,0,0" Height="30" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center"></Label>
                    <ComboBox Name="cbBuySell" Margin="20,10,0,0" Height="30" Width="100" SelectedIndex="{Binding Path=SelectedBuySell}">
                        <ComboBoxItem Content="Buy"></ComboBoxItem>
                        <ComboBoxItem Content="Sell"></ComboBoxItem>
                    </ComboBox>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label Content="OrderType" Foreground="{StaticResource Foreground}" Margin="10,10,0,0" Height="30" Width="120"  HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center"></Label>
                    <ComboBox Name="cbOrderType" Margin="20,10,0,0" Height="30" Width="100" SelectedIndex="{Binding Path=SelectedOrderType}">
                        <ComboBoxItem Content="Market"></ComboBoxItem>
                        <ComboBoxItem Content="Limit"></ComboBoxItem>
                        <ComboBoxItem Content="Stop"></ComboBoxItem>
                    </ComboBox>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label Content="Price" Foreground="{StaticResource Foreground}" Margin="10,10,0,0" Height="30" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center"></Label>
                    <xctk:DecimalUpDown Foreground="{StaticResource Foreground}" Background="{StaticResource LightBackground}" FormatString="C2" Value="{Binding Price, Mode=TwoWay}"  Increment="0.01" Minimum="0.01" Margin="20,10,0,0" Height="30" Width="100"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label Content="Size" Foreground="{StaticResource Foreground}" Margin="10,10,0,0" Height="30" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center"></Label>
                    <xctk:IntegerUpDown Foreground="{StaticResource Foreground}" Background="{StaticResource LightBackground}" FormatString="N0" Value="{Binding Size, Mode=TwoWay}"  Increment="{Binding SizeIncrement}" Margin="20,10,10,10" Height="30" Width="100"/>
                </StackPanel>
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Cancel Order" HorizontalAlignment="Left" Margin="10,10,10,10">
            <StackPanel Orientation="Vertical" Background="{StaticResource LightBackground}">
                <StackPanel Orientation="Horizontal">
                    <Label Content="{Binding SelectedOrderId}" Foreground="{StaticResource Foreground}" Margin="10,10,0,0" Height="30" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center"></Label>
                    <Button Content="Cancel Order" Margin="20,10,10,10" Height="30" Width="100" Command="{Binding CancelOrderCmd}"></Button>
                </StackPanel>
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Controls" HorizontalAlignment="Left" Margin="10,10,10,10" Width="250">
            <StackPanel Orientation="Vertical" Background="{StaticResource LightBackground}">
                <StackPanel Orientation="Horizontal">
                    <Button Content="Refresh Report" Margin="20,10,0,10" Height="30" Width="100" Command="{Binding GenerateReportCmd}"></Button>
                    <Button Content="{Binding ConnectDisconnectButtonText}" Margin="20,10,0,10" Height="30" Width="100" Command="{Binding ConnectDisconnectCmd}"></Button>
                </StackPanel>
            </StackPanel>
        </GroupBox>
    </StackPanel>
</UserControl>
